package code09集合.Map;

import java.util.Enumeration;
import java.util.Properties;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public class Test06_获取系统属性 {

    public static void main(String[] args) {
        Properties properties = System.getProperties();
        Enumeration<Object> en = properties.keys();
        while (en.hasMoreElements()) {
            Object key = en.nextElement();
            Object value = properties.get(key);
            System.out.println(key + ":" + value);
        }

        System.out.println("JAVA_HOME:" + System.getProperty("java.home"));
        System.out.println("字符集:" + System.getProperty("file.encoding"));
        System.out.println("java版本:" + properties.getProperty("java.version"));
    }

}